const express = require('express');
const { verifyToken } = require('../utiles/jwt');
const studentWorkContorller = require('../contorller/studentWorkContorller')
const router = express.Router();
const multer = require("multer");
const upload = multer({ dest: "public/uploads" });
router
//创建作业
.post('/create',verifyToken(),studentWorkContorller.createWork)
//获取作业列表
.get('/list',verifyToken(),studentWorkContorller.getWorkList)
//获取作业详情
.get('/detail',verifyToken(),studentWorkContorller.getWorkDetail)
//上传作业
.post('/upload',verifyToken(), upload.single("file"),studentWorkContorller.uploadWork)
//删除学生作业
.delete('/delete',verifyToken(),studentWorkContorller.deleteWork)
//删除作业文件夹
.post('/deleteFolder',verifyToken(),studentWorkContorller.deleteHomWork)
//获取作业文件夹
module.exports = router;